<template>
  <div id="home">
    <h1>这里是home的内容</h1>
    <button @click="toNews">新闻</button>
    <button @click="tozx">资讯</button>
    <button>快讯</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name:"Home",
  methods:{
    toNews(){
      this.$router.push("/home/news")
    },
    tozx(){
      this.$router.push("/home/zx")
    }
  },
  created() {
    console.log("home组件初始化");
  },
  activated() {
    console.log("当前组件处于活跃状态");
  },
  deactivated() {
    console.log("当前组件失去活跃状态");
  }
}
</script>

<style scoped>

</style>